package day03.test4;

import java.util.Scanner;

public class test4 {
    public static void main(String[] args) {
        //输入月份和年份 判断当前月份多少天  使用switch 完成
        System.out.print("请输入月份：");
        Scanner scan = new Scanner(System.in);
        int month = scan.nextInt();
        switch (month)//字符串  c常量
        {
            case 1:
                System.out.println(month + "月31天");
                break;
            case 2:
                //String run = (month%4 == 0 && month%100 !=0)||(month%400==0) ? "月29天":"月28天";
                System.out.println(month + "闰年月29天，平年28天");
                break;
            case 3:
                System.out.println(month + "月31天");
                break;
            case 4:
                System.out.println(month + "月30天");
                break;
            case 5:
                System.out.println(month+"月31天");
                break;
            case 6:
                System.out.println(month+"月30天");
                break;
            case 7:
                System.out.println(month+"月31天");
                break;
            case 8:
                System.out.println(month+"月31天");
                break;
            case 9:
                System.out.println(month+"月30天");
                break;
            case 10:
                System.out.println(month+"月31天");
                break;
            case 11:
                System.out.println(month+"月30天");
                break;
            case 12:
                System.out.println(month+"月31天");
                break;
            default:
                System.out.println("输入错误");
                break;
        }
    }
}
